<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="me.linczh.bank.bean.AccountBean" %>
<%@ page import="me.linczh.bank.bean.enums.AccountType" %>
<%@ page import="me.linczh.bank.bean.enums.DepositType" %>
<%@ page import="me.linczh.bank.bean.enums.ResultType" %>

<p>
	<%=request.getAttribute("contentpage") %>
</p>
<% if (request.getAttribute("result") != null) {
			ResultType result = (ResultType)request.getAttribute("result");
			if (result != ResultType.SUCCESS) {
 %>
<div class="alert alert-danger">
 <strong>操作失败</strong><br> <%=ResultType.parse(result) %> <a href="viewpage.action?page=account/withdrawal" class="alert-link">重新填写</a>
</div>
<%		} else {
				AccountBean abean = (AccountBean)request.getAttribute("accountBean");  %>
<div class="alert alert-success">
  <strong>操作成功</strong><br> 取款成功!
</div>
<div>
	<p>
	  <strong>账号</strong>&nbsp;<%=abean.getAccount() %>
	  <% switch (abean.getDeposittype()) {
	  		case CHECKING: %>
	  <span class="label label-primary">活期</span>
	  <%	break;
	  		default: %>
	  <span class="label label-success">定期</span>
	  <% } %>
	  <% switch (abean.getAccounttype()) {
	  		case PERSONAL_COMMON: %>
	  <span class="label label-info">个人普通账户</span>
	  <%	break;
	  		case PERSONAL_VIP: %>
	  <span class="label label-warning">个人VIP账户</span>
	  <%	break;
	  		default: %>
	  <span class="label label-danger">企业账户</span>
	  <% } %>
  </p>
  <p><strong>余额</strong>&nbsp;<%=abean.getBalance() %></p>
  <p><strong>开户时间</strong>&nbsp;<%=abean.getCreatetime() %></p>
</div>
<%		}
	} else { %>
<form action="account.withdrawal.action" method="POST" role="form">
	<fieldset>
		<legend>存款信息</legend>
		<div class="form-group">
	    <label for="account">账号</label>
	    <input type="text" class="form-control" id="account" name="account" placeholder="账号">
	  </div>
	  <div class="form-group">
	    <label for="balance">取款数额</label>
	    <input type="number" class="form-control" id="balance" name="balance" placeholder="取款数额">
	  </div>
	  <div class="form-group">
	    <label for="password">账户密码</label>
	    <input type="password" class="form-control" id="password" name="password" placeholder="账户密码">
	  </div>
	</fieldset>
	<button type="submit" class="btn btn-default">取款</button>
</form>
<% } %>